package com.lq.principle.segregation;

public class Segregation {
    public static void main(String[] args) {

    }
}
interface I{
    void i1();
    void i2();
    void i3();
    void i4();
    void i5();
}

class A{
    public void run(I i){
      i.i1();
      i.i2();
      i.i3();
    }
}
class B implements I{

    @Override
    public void i1() {
        System.out.println("B实现了i1方法");
    }

    @Override
    public void i2() {
        System.out.println("B实现了i2方法");
    }

    @Override
    public void i3() {
        System.out.println("B实现了i3方法");
    }

    @Override
    public void i4() {
        System.out.println("B实现了i4方法");
    }

    @Override
    public void i5() {
        System.out.println("B实现了i5方法");
    }
}
class C{
    public void  run(I i){
        i.i3();
        i.i4();
    }
}
class D implements I{

    @Override
    public void i1() {
        System.out.println("D实现了i1方法");
    }

    @Override
    public void i2() {
        System.out.println("D实现了i2方法");
    }

    @Override
    public void i3() {
        System.out.println("D实现了i3方法");
    }

    @Override
    public void i4() {
        System.out.println("D实现了i4方法");
    }

    @Override
    public void i5() {
        System.out.println("D实现了i5方法");
    }
}